CSharpTest.Net
RollbackTransaction Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.BPlusTree Assembly > CSharpTest.Net.Collections Namespace > TransactionLog<TKey,TValue> Class : RollbackTransaction Method

token

Glossary Item Box

Abandons the provided transaction

Syntax

Visual Basic (Declaration) 
Public Sub RollbackTransaction( _
   ByRef token As TransactionToken _
) 
C# 
public void RollbackTransaction( 
   ref TransactionToken token
)

Parameters

token

Example

BPlusTree/BPlusTree.Test/TestTransactionLog.cs

C#Copy Code
using (TempFile tmp = new TempFile())
using (var log = new TransactionLog<int, string>(Options(tmp)))
{
    var token = log.BeginTransaction();
    log.AddValue(ref token, 1, "test");
    log.RollbackTransaction(ref token);

    var test = new Dictionary<int, string>();
    log.ReplayLog(test);
    Assert.AreEqual(0, test.Count);
}
VB.NETCopy Code
Using tmp As New TempFile()
    Using log As var = New TransactionLog(Of Integer, String)(Options(tmp))
        Dim token As var = log.BeginTransaction()
        log.AddValue(token, 1, "test")
        log.RollbackTransaction(token)

        Dim test As var = New Dictionary(Of Integer, String)()
        log.ReplayLog(test)
        Assert.AreEqual(0, test.Count)
    End Using
End Using

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys